<h1>Sign up</h1>
<%= form_for @user do |f| %>
  <%if @user.errors.any?%>
    <div class="error_messages">
      <h2>Form is invalid</h2>
      <ul>
        <%for message in @user.errors.full_messages%>
        <li>
          <%=message%>
        </li>
        <%end%>
      </ul>
    </div>
  <%end%>
  <p>
    <%=f.label :forename%><br/>
    <%=f.text_field :forename%><br/>
  </p>
  <p>
    <%=f.label :lastname%><br/>
    <%=f.text_field :lastname%><br/>
  </p>
  <p>
    <%=f.label :email%><br/>
    <%=f.text_field :email%><br/>
  </p>
  <p>
    <%=f.label :age%><br/>
    <%=f.text_field :age%><br/>
  </p>
  <p>
    <%=f.label :password%><br/>
    <%=f.password_field :password%><br/>
  </p>
  <p>
    <%=f.label :password_confirmation%><br/>
    <%=f.password_field :password_confirmation%><br/>
  </p>
  <p class="button"><%=f.submit%></p>
<%end%>